package com.team.auth.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@Slf4j
public class AuthController {

    @Autowired
    private HttpServletRequest httpServletRequest;
    //gateway过滤器测试
    @RequestMapping("auth")
    public String auth(){
        String token = httpServletRequest.getHeader("token");
        String demo = httpServletRequest.getHeader("demo");
        System.out.println(token);
        System.out.println("全局："+demo);
        log.info("token");
        return "认证";
    }
}
